package com.hkts.beltweigher.synchronizationtask;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
@EnableScheduling
public class DataScheduledTask {

    @Autowired
    private SyncBeltWeigherUtil syncBeltWeigherUtil;
    @Scheduled(cron = "0/2 * * * * ?")
    private void configureTasks() throws Exception {
        //配料比例
        //syncBeltWeigherUtil.syncMatchsData();
        //实时数据
        syncBeltWeigherUtil.syncDisplayData();
        //仪表运行数据
        syncBeltWeigherUtil.syncYbRunAccumulateData();
        //实时计算运行数据
        syncBeltWeigherUtil.contrField();
    }
    @Scheduled(cron = "2 0/1 * * * ?")
    private void runIsLqxTasks() throws Exception {
        //分钟数据
        syncBeltWeigherUtil.syncIsLqxData();
        //实时修改系数
        syncBeltWeigherUtil.coefficientControlByTime();
    }
    /*@Scheduled(cron = "2 0 0/1 * * ?")
    private void hourTask(){
        //syncBeltWeigherUtil.syncYbHourAccumulateData();
    }*/

    @Scheduled(cron = "2 0 8,20 * * ?")
    private void dayTask(){
        //班组数据
        syncBeltWeigherUtil.syncYbClassAccumulateData();
    }

}
